<template>
  <div class="rules-container" v-title data-title="活动规则">
    <div class="content-card" v-html="rules">
    </div>
     </div>
</template>
<script>
  import { mapState,mapMutations } from 'vuex'
  import { httpReq } from '@/common/api'
  export default{
    name:'rules',
    data(){
      return{
        rules:''
      }
    },
    methods:{
      ...mapMutations(['changeUserToken']),
        getRules(){
          httpReq('GET','/list/as/app/financial/api/extension/brief').then((res)=>{
            this.rules = res.extension_explain
          }).catch((err)=>{
            this.$toast(err)
          })
        }
    },
    created(){
      //获取url中的用户信息
      const token = this.$route.query.token;
      if(token){
        this.changeUserToken(token)
      }
      //获取活动规则
      this.getRules()
    }
  }
</script>
<style lang="stylus" scoped>
  @import "~style/varibles.styl"
  .rules-container
    background $bgColor
    padding .2rem
    position fixed
    top 0
    bottom 0
    right 0
    left 0
    .content-card
      background white
      padding .32rem .36rem
      border-radius .08rem
      height 95%
      overflow scroll
      color $darkTextColor
</style>

